package com.myproject.thread.join;

public class SleepTest {

    //不管调用Thread.sleep(1000)还是调用其他线程的sleep方法，都是当前线程在sleep
    public static void main(String[] args) throws InterruptedException {

        //复杂用法
        System.out.println("start");
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread()+" hello");
            }
        });
        t.sleep(2000);
        System.out.println("end");


    }
}
